<?php
load_ctl("Common");
class SpController extends CommonController
{ 
	function init(){
		parent::init();
		load_model('SinglePage');
		$this->sp = new SinglePage();
    }
	public function indexAction(){
		if(isset($_GET["id"]) && is_numeric($_GET["id"])){
			$id = intval($_GET["id"]);
		}else{
			$this->_redirect('/');
		}
		$this->view->sp_info = $this->sp->get_sp_info($id);
		$this->view->webTitle = $this->view->sp_info["sp_title"].' - ';	
		$this->view->keywords = $this->view->sp_info["sp_title"];
		$this->view->description = $this->view->sp_info["sp_title"];	
		echo $this->view->render('sp.phtml');        
	}

	public function noRouteAction(){
		$this->_redirect('/');
	}
}
?>